package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TPurchaserMapper;
import com.ruoyi.system.domain.TPurchaser;
import com.ruoyi.system.service.ITPurchaserService;

/**
 * 采购商信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-22
 */
@Service
public class TPurchaserServiceImpl implements ITPurchaserService 
{
    @Autowired
    private TPurchaserMapper tPurchaserMapper;

    /**
     * 查询采购商信息
     * 
     * @param purchaserId 采购商信息主键
     * @return 采购商信息
     */
    @Override
    public TPurchaser selectTPurchaserByPurchaserId(Long purchaserId)
    {
        return tPurchaserMapper.selectTPurchaserByPurchaserId(purchaserId);
    }

    /**
     * 查询采购商信息列表
     * 
     * @param tPurchaser 采购商信息
     * @return 采购商信息
     */
    @Override
    public List<TPurchaser> selectTPurchaserList(TPurchaser tPurchaser)
    {
        return tPurchaserMapper.selectTPurchaserList(tPurchaser);
    }

    /**
     * 新增采购商信息
     * 
     * @param tPurchaser 采购商信息
     * @return 结果
     */
    @Override
    public int insertTPurchaser(TPurchaser tPurchaser)
    {
        return tPurchaserMapper.insertTPurchaser(tPurchaser);
    }

    /**
     * 修改采购商信息
     * 
     * @param tPurchaser 采购商信息
     * @return 结果
     */
    @Override
    public int updateTPurchaser(TPurchaser tPurchaser)
    {
        tPurchaser.setUpdateTime(DateUtils.getNowDate());
        return tPurchaserMapper.updateTPurchaser(tPurchaser);
    }

    /**
     * 批量删除采购商信息
     * 
     * @param purchaserIds 需要删除的采购商信息主键
     * @return 结果
     */
    @Override
    public int deleteTPurchaserByPurchaserIds(Long[] purchaserIds)
    {
        return tPurchaserMapper.deleteTPurchaserByPurchaserIds(purchaserIds);
    }

    /**
     * 删除采购商信息信息
     * 
     * @param purchaserId 采购商信息主键
     * @return 结果
     */
    @Override
    public int deleteTPurchaserByPurchaserId(Long purchaserId)
    {
        return tPurchaserMapper.deleteTPurchaserByPurchaserId(purchaserId);
    }
}
